<div id="map1" style="height: 100%">

</div>

<script type="text/javascript">
    var myChartMap1 = echarts.init(document.getElementById('map1'), 'macarons');
    var planePathMap1 = 'path://M1705.06,1318.313v-89.254l-319.9-221.799l0.073-208.063c0.521-84.662-26.629-121.796-63.961-121.491c-37.332-0.305-64.482,36.829-63.961,121.491l0.073,208.063l-319.9,221.799v89.254l330.343-157.288l12.238,241.308l-134.449,92.931l0.531,42.034l175.125-42.917l175.125,42.917l0.531-42.034l-134.449-92.931l12.238-241.308L1705.06,1318.313z';
    var colorMap1 = ['#a6c84c', '#ffa022', '#46bee9', '#D1E9B1', '#7DFF21'];
    var seriesMap1 = [];
    var legendMap1 = [];
    var optionMap1 = {
        backgroundColor: '#ffffff',
        title: {
            text: '订单分布情况',
            left: 'center',
            textStyle: {
                color: '#fff'
            },show:false
        },
        tooltip: {
            trigger: 'item'
        }, toolbox: {
            left: 'left',
            feature: {
                restore: {},
                saveAsImage: {}
            }
        },
        legend: {
            orient: 'vertical',
            top: 'bottom',
            left: 'right',
        //    data: legendMap1,
            textStyle: {
                color: '#fff'
            }
        },
        geo: {
            map: 'china',
            label: {
                emphasis: {
                    show: false
                }
            },
            roam: true,
            itemStyle: {
                normal: {
                    areaColor: '#323c48',
                    borderColor: '#404a59'
                },
                emphasis: {
                    areaColor: '#2a333d'
                }
            }
        },
       // series: seriesMap1
    };
    myChartMap1.setOption(optionMap1,true);
    function loadMap() {
        $.ajax({
            url: "#springUrl('/network/supply/costing/getDataMap')",
            data: {"batchId": "","selected":""},
            type: "POST",
            success: function (text) {
                var d = JSON.parse(text);
                if (d.success && d.data) {
                    loadMap1(d);
                }else{
                    toastr.error('没有数据，请上传配送中心数据');
                    var div1="<div type='text' style='padding-top:18%' class=' text-center '>"+d.message+"</div>";
                    document.getElementById('map1').innerHTML=div1;
                }
            }
        });
    }
    function loadMaps() {
        var selected=$("select[name='prjId']").val();
        $.ajax({
            url: "#springUrl('/network/supply/costing/getDataMap')",
            data: {"batchId": "","selected":selected.toString()},
            type: "POST",
            success: function (text) {
                var d = JSON.parse(text);
                if (d.success && d.data) {
                    loadMap1(d);
                }else{
                    toastr.error('没有数据，请上传配送中心数据');
                    var div1="<div type='text' style='padding-top:18%' class=' text-center '>"+d.message+"</div>";
                    document.getElementById('map1').innerHTML=div1;
                }
            }
        });
    }
    function loadMap1(d){
        initMap2(d);
        myChartMap1.clear();
        d.data.forEach(function (item, i) {
            legendMap1.push(item.name);
            seriesMap1.push({
                name: "",
                type: 'effectScatter',
                coordinateSystem: 'geo',
                zlevel: 2,
                rippleEffect: {
                    brushType: 'stroke'
                },
                label: {
                    normal: {
                        show: false,
                        position: 'right',
                        formatter: '{b}'
                    }
                },
                symbolSize: function (val) {
                    return val[2] / 8;
                },
                itemStyle: {
                    normal: {
                        color: colorMap1[i]
                    }
                },
                data:item.nodes
            });
        });
        optionMap1.series=seriesMap1;
        optionMap1.legend.data=legendMap1;
        myChartMap1.setOption(optionMap1,true);
    }

</script>